#ifndef _ARRAY_H_
#define _ARRAY_H_

#include <iostream>

template <class T> class Array
{
public:
	//----------------------
	// Public methods
	//----------------------

	Array( int size = 8, int step = 8);
	~Array();

	
	Array( const Array<T>& copy);
	T& operator [] ( int ind );
	void operator << ( T item );

	T& get( int indice );

	void push( T item );
	void push( T * items, int itemsSize );
	
	void insertAt( T item, int indice );
	void remove( int indice );
	void removeFirst( T item );
	void removeAll( T item );

	int getSize( void );
	int getArraySize( void );
	T * getArrayPointer( void );

	int findItem( T item, int begin = 0 );

	void clear();
	void destroy();
protected:
	//---------------------------
	// Protected methods
	//---------------------------
	void increaseArraySize( int step = -1);

	T * m_data;

	int m_initSize;
	int m_dataSize;
	int m_arraySize;
	int m_increaseStep;

public:
	//------------------------
	// Public members
	//------------------------
	static const int ITEM_NOT_FOUND;
};

#include "Array.cc"
#endif
